<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <iframe id="pdf-preview"></iframe>
<button onclick="loadPDF()">预览 PDF</button>

<script>
  async function loadPDF() {
    try {
      const response = await fetch("https://www.lucky520134.top:40341/weaver/weaver.file.FileDownload?fileid=6185&download=1&ddcode=0e3154be61f9b051");
      const blob = await response.blob();
      const objectUrl = URL.createObjectURL(blob);

      // 将 Blob URL 传递给 iframe
      const iframe = document.getElementById("pdf-preview");
      iframe.src = objectUrl;

      // 释放内存（可选：在关闭预览时执行）
      // iframe.onload = () => URL.revokeObjectURL(objectUrl);
    } catch (error) {
      console.error("加载 PDF 失败:", error);
    }
  }
</script>

    
</body>
</html>